import axios from 'axios'

axios.defaults.baseURL = 'http://192.168.10.32:18090'
// axios.defaults.baseURL = 'https://api.lianpucom.com'

const service = axios.create({
  timeout: 40000,
  headers: {
    'X-Requested-With': 'XMLHttpRequest',
    'Content-Type': 'application/json; charset=UTF-8',
    // 'Authorization':'+PQddp7K9/npTSwpE4/SqACwvNg3YRjGRKaTycLgoE/Knh0y0qois5XlZXMfWEG+usaIgPwdioZs+covHubrYKlr+qe+xYa6WHRvPNC0V2U='
  },
})
service.interceptors.request.use(
  config => {
    return config
  },
  error => {
    Promise.reject(error)
  }
)

// response interceptor
service.interceptors.response.use(
  response => {
    const res = response.data
    return res
  },
  error => {
  }
)
export default service
